/**
 * Created by hps on 17-4-27.
 */
public class Reverser {
    private String input;
    private StringBuffer output;

    public Reverser(String input) {
        this.input = input;
    }

    public String  doRev() {
        if(input == null)
            return null;
        int len = input.length();
        StackX1 stackX1 = new StackX1(len);
        for (int i = 0; i < len; i++) {
            stackX1.push(input.charAt(i));
        }

        output = new StringBuffer();
        while (!stackX1.isEmpty())
            output.append(stackX1.pop());
        return output.toString();
    }
}
